From 9b981ee160d11b28e4149e97e438a87239fd234c Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Tue, 27 Feb 2007 11:19:25 +0000 Subject: [PATCH] Fix exception handling to cope with exceptions that do not have a string as the first argument. Signed-off-by: Ewan Mellor --- tools/python/xen/util/xmlrpclib2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/util/xmlrpclib2.py b/tools/python/xen/util/xmlrpclib2.py index c701020b15..a77b61b5ee 100644 --- a/tools/python/xen/util/xmlrpclib2.py +++ b/tools/python/xen/util/xmlrpclib2.py @@ -238,8 +238,11 @@ class TCPXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer): notSupportedRE = re.compile(r'method "(.*)" is not supported') def _is_not_supported(exn): - m = notSupportedRE.search(exn[0]) - return m is not None + try: + m = notSupportedRE.search(exn[0]) + return m is not None + except TypeError, e: + return False # This is a XML-RPC server that sits on a Unix domain socket. -- 2.30.2